package com.newtouch.avmarketing.api.repo;

import com.newtouch.avmarketing.api.model.DoubleIndexDto;
import com.newtouch.avmarketing.mgr.modules.avmarkrting.entity.DoubleConfiguration;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface DoubleConfigurationIndexRepo extends JpaRepository<DoubleConfiguration,Long>,
        JpaSpecificationExecutor<DoubleConfiguration> {
    /**
     * 客户端双录信息查询   表名==实体类对象的名称 DoubleConfiguration
     * @param id
     * @return
     */
    @Query(value = "select new com.newtouch.avmarketing.api.model.DoubleIndexDto" +
            "(a.id,a.stepName,a.sbContent,a.file) " +
            "from DoubleConfiguration  a where a.id = ?1 and a.isDeleted = '0' ")
    DoubleIndexDto findDoubleIndexDto(Long id);
}
